package qingke.pojo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="order_item")
public class OrderItem {

	@Id
	@Column(name = "id")
	private int id;
	@Column(name = "amount")
	private int amount;
	@Column(name = "memo")
	private String memo;
	
	@ManyToOne
	@JoinColumn(name = "order1_id")
	private Order order;
	
	@ManyToOne
	@JoinColumn(name = "product_id")
	private Product product;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getAmount() {
		return amount;
	}

	public void setAmount(int amount) {
		this.amount = amount;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	
	public String toString() {
		return "OrderItem [id=" + id + ", amount=" + amount + ", memo=" + memo +product.toString()+ "]";
	}
	public String toString1() {
		return "OrderItem [id=" + id + ", amount=" + amount + ", memo=" + memo + "]";
	}
	
}
